<template>
  <div class="content">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="社保档案" name="first">
        <insurance-file></insurance-file>
      </el-tab-pane>
      <el-tab-pane label="社保方案" name="third">
        <insurance-scheme></insurance-scheme>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import insuranceFile from './insuranceFile/insuranceFile.vue'   //社保档案
import insuranceScheme from './insuranceScheme/insuranceScheme.vue'   //社保方案
export default {
  components:{
    insuranceFile,
    insuranceScheme
  },
  data() {
    return {
      activeName: "first",
      tableData: [
        {
          id: "12987122",
          name: "王小虎",
          amount1: "234",
          amount2: "3.2",
          amount3: 20,
        },
        {
          id: "12987122",
          name: "王小虎",
          amount1: "234",
          amount2: "3.2",
          amount3: 10,
        },
        {
          id: "12987122",
          name: "王小虎",
          amount1: "234",
          amount2: "3.2",
          amount3: 30,
        },
      ],
      queryParams: {
        employeeCode: null,
        employeeName: null,
        employeeTel: null,
        employeeJoinStatus: null,
        employeeFormalStatus: null,
        employeeLeaveStatus: null,
        employeeRetiredStatus: null,
        current: 1, //当前页码
        size: 10, //每页显示数量
      },
      grades: [
        {
          gradeCode: "教职员工薪酬方案",
          gradeName: "四川城院、计算机学院",
          sort: 532548,
        },
        {
          gradeCode: "教职员工薪酬方案",
          gradeName: "四川城院、计算机学院",
          sort: 532548,
        },
        {
          gradeCode: "教职员工薪酬方案",
          gradeName: "四川城院、计算机学院",
          sort: 532548,
        },
        {
          gradeCode: "教职员工薪酬方案",
          gradeName: "四川城院、计算机学院",
          sort: 532548,
        },
      ],
    };
  },
  methods: {
    handleClick(tab, event) {
      let name = tab.name;
      switch (name) {
        case "holdPost":
          this.queryParams.employeeStatus = "2";
          this.tableCols = [
            {
              prop: "employeeName",
              label: "中文姓名",
              show: true,
              disable: false,
            },
            { prop: "employeeCode", label: "工号", show: true, disable: false },
            {
              prop: "employeeStatus",
              label: "转正状态",
              show: true,
              disable: false,
            },
            { prop: "postName", label: "岗位名称", show: true, disable: false },
            {
              prop: "postTypeName",
              label: "岗位类别",
              show: true,
              disable: false,
            },
            {
              prop: "gradeName",
              label: "岗位职级",
              show: true,
              disable: false,
            },
            {
              prop: "organizationName",
              label: "直属组织",
              show: true,
              disable: false,
            },
            {
              prop: "employeeEmployType",
              label: "雇佣性质",
              show: true,
              disable: false,
            },
            {
              prop: "employeeInHeadship",
              label: "编制类型",
              show: true,
              disable: false,
            },
            {
              prop: "employeeGender",
              label: "性别",
              show: true,
              disable: false,
            },
            { prop: "age", label: "年龄", show: true, disable: false },
            {
              prop: "employeeTel",
              label: "手机号",
              show: true,
              disable: false,
            },
          ];
          break;
        case "leave":
          this.queryParams.employeeStatus = "3";
          this.tableCols = [
            {
              prop: "employeeName",
              label: "中文姓名",
              show: true,
              disable: false,
            },
            { prop: "employeeCode", label: "工号", show: true, disable: false },
            { prop: "postName", label: "岗位名称", show: true, disable: false },
            {
              prop: "postTypeName",
              label: "岗位类别",
              show: true,
              disable: false,
            },
            {
              prop: "gradeName",
              label: "岗位职级",
              show: true,
              disable: false,
            },
            {
              prop: "organizationName",
              label: "直属组织",
              show: true,
              disable: false,
            },
            {
              prop: "employeeEmployType",
              label: "雇佣性质",
              show: true,
              disable: false,
            },
            {
              prop: "employeeInHeadship",
              label: "编制类型",
              show: true,
              disable: false,
            },
            {
              prop: "employeeGender",
              label: "性别",
              show: true,
              disable: false,
            },
            { prop: "age", label: "年龄", show: true, disable: false },
            {
              prop: "employeeJoinTime",
              label: "入职日期",
              show: true,
              disable: false,
            },
            {
              prop: "employeeLeaveTime",
              label: "离职日期",
              show: true,
              disable: false,
            },
            {
              prop: "employeeLeaveType",
              label: "离职类型",
              show: true,
              disable: false,
            },
          ];
          break;
        case "retired":
          this.queryParams.employeeStatus = "4";
          this.tableCols = [
            {
              prop: "employeeName",
              label: "中文姓名",
              show: true,
              disable: false,
            },
            { prop: "employeeCode", label: "工号", show: true, disable: false },
            { prop: "postName", label: "岗位名称", show: true, disable: false },
            {
              prop: "postTypeName",
              label: "岗位类别",
              show: true,
              disable: false,
            },
            {
              prop: "gradeName",
              label: "岗位职级",
              show: true,
              disable: false,
            },
            {
              prop: "organizationName",
              label: "直属组织",
              show: true,
              disable: false,
            },
            {
              prop: "employeeEmployType",
              label: "雇佣性质",
              show: true,
              disable: false,
            },
            {
              prop: "employeeInHeadship",
              label: "编制类型",
              show: true,
              disable: false,
            },
            {
              prop: "employeeGender",
              label: "性别",
              show: true,
              disable: false,
            },
            { prop: "age", label: "年龄", show: true, disable: false },
            {
              prop: "employeeJoinTime",
              label: "入职日期",
              show: true,
              disable: false,
            },
            {
              prop: "employeePlanLeaveTime",
              label: "计退休日期",
              show: true,
              disable: false,
            },
            {
              prop: "employeeRetiredTime",
              label: "办理日期",
              show: true,
              disable: false,
            },
          ];
          break;
        default:
          this.queryParams.employeeStatus = "2";
          this.tableCols = [
            {
              prop: "employeeName",
              label: "中文姓名",
              show: true,
              disable: false,
            },
            { prop: "employeeCode", label: "工号", show: true, disable: false },
            {
              prop: "employeeStatus",
              label: "转正状态",
              show: true,
              disable: false,
            },
            { prop: "postName", label: "岗位名称", show: true, disable: false },
            {
              prop: "postTypeName",
              label: "岗位类别",
              show: true,
              disable: false,
            },
            {
              prop: "gradeName",
              label: "岗位职级",
              show: true,
              disable: false,
            },
            {
              prop: "organizationName",
              label: "直属组织",
              show: true,
              disable: false,
            },
            {
              prop: "employeeEmployType",
              label: "雇佣性质",
              show: true,
              disable: false,
            },
            {
              prop: "employeeInHeadship",
              label: "编制类型",
              show: true,
              disable: false,
            },
            {
              prop: "employeeGender",
              label: "性别",
              show: true,
              disable: false,
            },
            { prop: "age", label: "年龄", show: true, disable: false },
            {
              prop: "employeeTel",
              label: "手机号",
              show: true,
              disable: false,
            },
          ];
          break;
      }
      this.getPageList();
    },
    clickReset() {
      this.reset = !this.reset;
    },
    resetQuery() {
      this.queryParams = {
        employeeCode: null,
        employeeName: null,
        employeeTel: null,
        employeeStatus: "2",
        size: 10,
        current: 1,
      };
      this.getPageList();
    },
    // 翻页
    handleCurrentChange(val) {
      this.queryParams.current = val;
      this.getPageList();
    },
  },
};
</script>
<style lang="scss" scoped>
.content{
  padding: 20px;
}
</style>
